package org.csmz.class2334;

public class example07 {
    public static void main(String[] args){
        String id = "user";
        String time = "2023-1112-1336";
        String orderId = id.concat(time);
        System.out.println("将字符串"+time+"拼接字符串"+id+"的末尾,"+"生成的订单为"+orderId);
        System.out.println("截取字符串"+orderId+"的第5个字符到第14个字符"+id+"的结果为"+orderId.substring(4,13));
        System.out.println("将字符串"+time+"用符号-分割为若干个字符串,结果为");
        String[] times = time.split("-");
        for (int i = 0; i < times.length; i++) {
            if (i != times.length -1){
                System.out.println(times[i]+",");
            }else{
                System.out.println(times[i]);
            }
        }
    }
}